<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="../WEB-INF/template_admin.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreatePersonaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">

            <div class="content">

                <br />
                <ul class="lista-mapa-sitio">
                    <li><a href="#{request.contextPath}/faces/administrador.xhtml">Administrar</a> / </li>
                    <li><a href="#{request.contextPath}/faces/persona/ListaPersona.xhtml">Registros</a> / </li>
                    <li>Crear Registro</li>
                </ul>
                <p:panel header="Crear Registro" styleClass="panel-usuario" style="width: 600px">
                    <p:growl id="growl" />
                    <h:panelGroup id="messagePanel" layout="block">
                        <p:messages autoUpdate="true"/>
                    </h:panelGroup>
                    <h:form>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="#{bundle.CreatePersonaLabel_personaNombre}" for="personaNombre" />
                            <p:inputText id="personaNombre" value="#{personaController.selected.personaNombre}" title="#{bundle.CreatePersonaTitle_personaNombre}" required="true" requiredMessage="#{bundle.CreatePersonaRequiredMessage_personaNombre}"/>
                            <h:outputLabel value="#{bundle.CreatePersonaLabel_personaApellido}" for="personaApellido" />
                            <p:inputText id="personaApellido" value="#{personaController.selected.personaApellido}" title="#{bundle.CreatePersonaTitle_personaApellido}" required="true" requiredMessage="#{bundle.CreatePersonaRequiredMessage_personaApellido}"/>
                            <h:outputLabel value="#{bundle.CreatePersonaLabel_personaFechaNac}" for="personaFechaNac" />
                            <p:calendar id="personaFechaNac" pattern="dd/MM/yyyy" yearRange="c-30:c+20" locale="es" effect="fadeIn" navigator="true" value="#{personaController.selected.personaFechaNac}" title="#{bundle.EditPersonaTitle_personaFechaNac}" required="true" requiredMessage="#{bundle.EditPersonaRequiredMessage_personaFechaNac}"/>
                            <h:outputLabel value="#{bundle.CreatePersonaLabel_catDocumento}" for="catDocumento" />
                            <p:selectOneMenu id="catDocumento" value="#{personaController.selected.catDocumento}">
                                <f:selectItems value="#{catDocumentoController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                            <h:outputLabel value="#{bundle.CreatePersonaLabel_personaDireccionId}" for="personaDireccionId" />
                            <p:selectOneMenu id="personaDireccionId" value="#{personaController.selected.personaDireccionId}" required="true" requiredMessage="#{bundle.CreatePersonaRequiredMessage_personaDireccionId}">
                                <f:selectItems value="#{catDireccionController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                        </h:panelGrid>
                        <br />
                        <p:commandLink actionListener="#{personaController.create}" value="#{bundle.CreatePersonaSaveLink}" update=":growl"/>
                        <br />
                        <br />
                        <h:commandLink class="jsfcrud_commandlinks_action" action="#{personaController.prepareList}" value="#{bundle.CreatePersonaShowAllLink}" immediate="true"/>
                        <br />
                        <br />
                    </h:form>
                </p:panel>
            </div><!-- end of content -->
        </ui:define>
    </ui:composition>

</html>
